import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Pageable } from '../domain/sparrow';

@Injectable({
  providedIn: 'root'
})
export class LogService {
  host:string = "http://localhost:8091/api";

  constructor(private httpClient: HttpClient) { }

  list(pageable: Pageable|any){
    let p:Pageable|any = {page: 0, size: 10}
    p.page=pageable.page -1;
    p.size = pageable.size;
    if(pageable.sort)
      p.sort = pageable.sort;
    return this.httpClient.get<any>(this.host+"/logs/auditLog",{ params:p})
  }

}
